package net.scribblemedia.sqldsk.domain;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.OneToMany;

import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooEntity(finders = { "findDatabaseDriversByDriverClassEquals" })
public class DatabaseDriver {

	@OneToMany
	private List<DatabaseConfig> databaseConfigs;
	
    private String driverClass;

    private String urlFormat;
    
    public void addDatabaseConfig(DatabaseConfig databaseConfig) {
    	if (databaseConfigs == null) {
    		databaseConfigs = new ArrayList<DatabaseConfig>();
    	}
    	
    	databaseConfigs.add(databaseConfig);
    	databaseConfig.setDriver(this);
    }
}
